package top.hcode.hoj.utils;

import lombok.Getter;
import org.springframework.context.ApplicationContext;

/**
 * @author orangej
 * @since 2024/12/12
 */
public class ContextUtil {
    @Getter
    private static ApplicationContext context;

    public static void setContext(ApplicationContext context) {
        ContextUtil.context = context;
    }

    public static <T> T getBean(Class<T> clazz) {
        return context.getBean(clazz);
    }
}
